package com.mi.fastbird.common.spring.interceptor;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * 添加拦截器
 *
 * @author 王永吉
 * @date 2019/6/27 8:44
 */
@Slf4j
@Configuration
public class AddInterceptor implements WebMvcConfigurer {
    //全局拦截器
    @Resource
    private GlobalInterceptor global_interceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(global_interceptor)
                .addPathPatterns("/**");
        log.info(".............. 拦截器注册完成 ..............");
    }
}
